﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.LeaveCommand;
using RBAC.MaHaiBo.Service;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.LeaveHandler
{
    public class LeaveDeleteCommandHandler:IRequestHandler<LeaveDeleteCommand,int>
    {
        /// <summary>
        /// 请假服务层
        /// </summary>
        ILeaveService lSer;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="lSer">请假服务层</param>
        public LeaveDeleteCommandHandler(ILeaveService lSer)
        {
            this.lSer = lSer;
        }

        public async Task<int> Handle(LeaveDeleteCommand request, CancellationToken cancellationToken)
        {
            return await lSer.LeaveDel(request.Lid);
        }
    }
}
